import BasicLayout from '@/layout/BasicLayout.vue'
import UserLayout from '@/layout/UserLayout.vue'
import childRoutes from './childRoutes'

/* 基础路由 */
const routes = [
  {
    path: '/user',
    name: 'user',
    meta: {
      hidden: true,
      level: 1,
      id: 'user',
      parentId: null,
    },
    component: UserLayout,
    redirect: '/user/login',
    children: [
      {
        path: 'login',
        name: 'user-login',
        meta: {
          title: '登录',
          hidden: true,
          level: 2,
          id: 'user-login',
          //父级id
          parentId: 'user',
        },
        component: () => import('@/views/user/Login.vue'),
      },
    ],
  },
  {
    path: '/',
    name: 'home',
    meta: {
      hidden: true,
      level: 1,
      id: 'home',
      parentId: null,
    },
    component: BasicLayout,
    redirect: '/index/welcome',
    //主页各种子集路由
    children: childRoutes,
  },
  {
    path: '/:pathMatch(.*)*',
    name: 'error',
    meta: {
      title: '404',
      hidden: true,
      level: 1,
      id: 'error',
      parentId: null,
    },
    component: () => import('@/views/404/index.vue'),
  },
]
export default routes
